<%@ Page Language="VB" StylesheetTheme="default" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="QuestionnaireManager.aspx.vb" Inherits="Modules_Questionnaires_Management_QuestionnaireManager" title="Questionnaire Manager Page" %>
<%@ Register Assembly="DotNetPM.Web.UI.WebControls" TagPrefix="cc" Namespace="DotNetPM.Web.UI.WebControls" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table id="Table1" cellpadding="2" cellspacing="2" width="100%">
        <tr>
            <td colspan="4">
                <strong><font size="2">
                    <table cellpadding="0" cellspacing="0" width="100%">
                        <tr>
                            <td>
                                <asp:Image ID="Image1" runat="server" ImageAlign="AbsMiddle" ImageUrl="~/Images/qnman.gif" />
                                <strong><font size="3">QUESTIONNAIRE MANAGER</font></strong></td>
                            <td align="right">
                                <cc:dynimagebutton id="iButQuestion" runat="server" imagealign="AbsMiddle" imageurl="~/Images/qman_0.gif"
                                    tooltip="Question Manager">
                                </cc:dynimagebutton>
                                <cc:dynimagebutton id="iButInstrument" runat="server" imagealign="AbsMiddle" imageurl="~/Images/iman_0.gif"
                                    tooltip="Instrument Manager">
                                </cc:dynimagebutton></td>
                        </tr>
                    </table>
                </font></strong></td>
            <td align="right" colspan="1">
                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="Default.aspx" ForeColor="Blue">Back</asp:HyperLink></td>
        </tr>
        <tr>
            <td colspan="5" valign="top">
                <hr size="1" width="100%" /></td>
        </tr>
        <tr>
            <td rowspan="2" valign="top" width="15">&nbsp;</td>
            <td valign="top">
                <table border=0 cellpadding="4" >
                    <tr>
                        <td width=100 align="right">StudyID :</td>
                        <td width=120 >
                            <asp:DropDownList ID="ddlStudyID" runat="server" AppendDataBoundItems="True" DataSourceID="StudyIDsDS" DataTextField="StudyID" DataValueField="StudyID" AutoPostBack="True">
                                <asp:ListItem Selected="True" Value="Show All">Show All</asp:ListItem>
                            </asp:DropDownList>
                            <asp:ObjectDataSource ID="StudyIDsDS" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetStudyIDsDDL" TypeName="DotNetPM.Business.Questionnaire.QuestionnaireODS">
                            </asp:ObjectDataSource>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">InstrumentID :</td>
                        <td ><asp:DropDownList ID="ddlInstrumentID" runat="server" AppendDataBoundItems="True" DataSourceID="InstrumentIDsDS" DataTextField="Text" DataValueField="InstrumentID" AutoPostBack="True">
                            <asp:ListItem Selected="True" Value="Show All">Show All</asp:ListItem>
                        </asp:DropDownList><asp:ObjectDataSource ID="InstrumentIDsDS" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetInstrumentIDsDDL" TypeName="DotNetPM.Business.Questionnaire.QuestionnaireODS">
                            </asp:ObjectDataSource>
                        </td>
                    </tr>
                </table></td>
            <td align="right" valign="bottom">
                <asp:LinkButton ID="lbutNew" runat="server" Font-Bold="True"><SPAN style="POSITION: relative; TOP: -4px; left:-4px">Add A New Questionnaire</SPAN><img src="../../Images/New.gif" style="border-width:0px;POSITION: relative;" /></asp:LinkButton></td>
            <td colspan="2" valign="top" />
        </tr>
        <tr>
            <td colspan="2" height="350" valign="top">
                <asp:GridView ID="gvQuestionnaires" runat="server" AllowPaging="True" DataSourceID="odsQuestionnaires" AllowSorting="True" Width="820px" EmptyDataText="<div align=center><br/><strong>There is no questionnaire in the database.</strong><br/><br/></div>" AutoGenerateColumns="False" DataKeyNames="ID">
                    <Columns>
                        <asp:BoundField DataField="StudyID" HeaderText="Study ID" SortExpression="StudyID" >
                            <ItemStyle HorizontalAlign="Center" Width="82px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="VisitNumber" HeaderText="Visit #" SortExpression="VisitNumber" >
                            <ItemStyle HorizontalAlign="Center" Width="46px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="InstrumentID" HeaderText="Instrument" SortExpression="InstrumentID" >
                            <ItemStyle HorizontalAlign="Center" Width="82px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
                        <asp:TemplateField ShowHeader="False">
                            <ItemTemplate>
                                <asp:HiddenField ID="hfID" runat="server" Value=<%# Bind("ID") %> />
                                <cc:DynImageButton ID="ibDetail" runat="server" CausesValidation=false CommandName="cmdDetail" 
                                     CommandArgument='<%# Container.DataItemIndex %>' AlternateText="Detail" ImageUrl="~/Images/Detail_0.gif"/>
                                <cc:DynImageButton ID="ibEdit" runat="server" CausesValidation=false CommandName="cmdEdit" 
                                     CommandArgument='<%# Container.DataItemIndex %>' AlternateText="Edit" ImageUrl="~/Images/Edit_0.gif"/>
                                <cc:DynImageButton ID="ibPerm" runat="server" CausesValidation=false CommandName="cmdPerm" 
                                     CommandArgument='<%# Container.DataItemIndex %>' AlternateText="Permission" ImageUrl="~/Images/Perm_0.gif"/>
                            </ItemTemplate>
                            <ItemStyle Width="60px" />
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        <table  border="0" cellpadding="2" cellspacing="2"
                            style="BORDER-TOP-WIDTH:1px;BORDER-LEFT-WIDTH:1px;BORDER-LEFT-COLOR:black;LEFT:0px;BORDER-BOTTOM-WIDTH:1px;
                            BORDER-BOTTOM-COLOR:black;MARGIN:-4px;WIDTH:820px;BORDER-TOP-COLOR: black;TOP:0px;BACKGROUND-COLOR:white;
                            BORDER-RIGHT-WIDTH:1px;BORDER-RIGHT-COLOR: black">
                            <tr style="font-weight: bold; color: mistyrose; background-color: #4a3c8c">
                                <th style="width: 82px">Study ID</th>
                                <th style="width: 46px">Visit #</th>
                                <th style="width: 82px">Instrument</th>
                                <th>Description</th>
                                <th style="width: 60px">&nbsp;</th>
                            </tr>
                            <tr style="color:Black;background-color:#EEEEEE;">
	                            <td colspan="5" align="center" >
	                                <br /><strong>There is no questionnaire in the database.</strong><br /><br />
	                            </td>
                            </tr>
                        </table>
                    </EmptyDataTemplate>
                </asp:GridView>
                <asp:ObjectDataSource ID="odsQuestionnaires" runat="server"
                    SelectMethod="GetQuestionnaires" TypeName="DotNetPM.Business.Questionnaire.QuestionnaireODS" OldValuesParameterFormatString="original_{0}" DeleteMethod="DeleteQuestionnaire">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="ddlStudyID" Name="studyId" PropertyName="SelectedValue"
                            Type="String" />
                        <asp:ControlParameter ControlID="ddlInstrumentID" Name="instrumentId" PropertyName="SelectedValue"
                            Type="String" />
                    </SelectParameters>
                    <DeleteParameters>
                        <asp:Parameter Name="original_ID" Type="Int32" />
                    </DeleteParameters>
                </asp:ObjectDataSource>
            </td>
            <td colspan="2"  valign="top">
            </td>
        </tr>
    </table>
</asp:Content>

